package com.gmrz.webauthn.protocol.v1.schema;

public enum WebOperationType {
    CREATE("webauthn.create"),
    GET("webauthn.get");

    private String opType;

    WebOperationType(String opType) {
        this.opType = opType;
    }

    public String getOpType() {
        return this.opType;
    }

    public void setOpType(String opType) {
        this.opType = opType;
    }

    public static WebOperationType forName(String name) {
        for (WebOperationType type : values()) {
            if (type.getOpType().equalsIgnoreCase(name)) {
                return type;
            }
        }
        throw new IllegalArgumentException("Invalid operation type: " + name);
    }
}
